package cn.tuling;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.PropertySource;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@SpringBootApplication
@PropertySource("app.properties")
public class Application {

    public static void main(String[] args) throws IOException {

        SpringApplication application = new SpringApplication(Application.class);
        Properties properties = new Properties();

        //InputStream config = application.getClassLoader().getResourceAsStream("app.properties");
        InputStream config = Application.class.getClassLoader().getResourceAsStream("app.properties");
        properties.load(config);

        application.setDefaultProperties(properties);

        application.run(Application.class, args);
    }

}
